#include<bits/stdc++.h>
#include<queue>
using namespace std;
queue<int> a,b;
int n,c[500001],d1[500001],d2[500001],pd=1,m=-1,ans,len;
int main()
{
	freopen("fruit.in","r",stdin);
	freopen("fruit.out","w",stdout);
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&c[i]);
	}
	while(ans<n){
		m=-1;
		for(int i=1;i<=n;i++){
			if(c[i]!=m&&c[i]!=-1){
				printf("%d",i);
				ans++;
				m=c[i];
				c[i]=-1;
			}
		}
		printf("\n");
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
}
